﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="BaseData_SelectCoupon" Codebehind="SelectCoupon.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <script type="text/javascript">
        function ChangeCoupon(ctl)
        {
            var selectedCouponCode="";
            for(var i =0;i<ctl.options.length;i++)
            {
                if(ctl.options[i].selected == true)
                {
                    selectedCouponCode =ctl.options[i].value; 
                    break;
                }
            }
            var arg = selectedCouponCode;
                    
            <%= ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "")%>; 
        }
        function ReceiveServerData(result)  
        {
            document.getElementById("couponDetails").innerHTML = result;
        }
        function returnf()
         {
              var temp=document.getElementsByName("checkbox"); 
              var strvalue="";
              for (i=0;i<temp.length;i++)
              { 
                   if( i+1==temp.length)
                   {
                        if(temp[i].checked==true) 
                        {
                            strvalue += temp[i].value; 
                        } 
                   }
                   else
                   {
                        if(temp[i].checked==true) 
                        {
                            strvalue += temp[i].value + "$"; 
                        }
                   }
                   
             
              }
             window.returnValue = strvalue;
             window.close();
            
         }
         function CloseWindow()
         {
             window.returnValue = "";
             window.close();
         }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:DropDownList ID="dropCoupon" runat="server" onchange="ChangeCoupon(this)">
        </asp:DropDownList>
        <div id="couponDetails">
        
        </div>
        <table cellpadding="0" cellspacing="0" border="0" style="width: 750px;">
                <tr>
                    <td valign="top" align="left" class="menu_bg" style="height: 24px">
                        <input id="Button1" type="button" value="确定" class="input_button" onclick="returnf();" />
                        <input id="Button2" type="button" value="取消" class="input_button" onclick="CloseWindow();" />
                    </td>
                </tr>
        </table>
    </div>
    </form>
</body>
</html>
